<template>
	<div class="theme">
		<van-nav-bar title="个人设置" left-text="返回" left-arrow @click-left="onClickLeft" />
		<div class="overlay headTop">
			<div class="overlay-content scrolling">
				<div style="padding-top: 10px;">
					<van-cell is-link @click="updateOne">修改登录密码</van-cell>
					<van-cell is-link @click="updateTwo">修改交易密码</van-cell>
				</div>
				<div style="padding-left: 20px;padding-right: 20px;padding-bottom: 40px;padding-top: 30px;" align="center">
					<van-button round type="info" style="width: 100%;" @click="loginOut">退出</van-button>
				</div>
			</div>
		</div>
	</div>
</template>

<script>
	let _this;
	import { Dialog } from 'vant';
	import { base } from './../utils/api';
	export default {
		name: 'Setting',
		components: {},
		props: {},
		data() {
			return {};
		},
		beforeCreate() {
			_this = this;
		},
		watch: {},
		computed: {},
		methods: {
			onClickLeft() {
				this.$router.push({
					path: '/Mine'
				});
			},
			updateOne() {
				this.$router.push({
					path: '/UpdatePwd'
				});
			},
			updateTwo() {
				this.$router.push({
					path: '/UpdatePayPwd'
				});
			},
			loginOut() {
				Dialog.confirm({
					message: '确定要退出吗？',
					confirmButtonText: '确定',
					cancelButtonText: '取消',
				}).then(() => {
					base.getSignOut().then(res => {
						sessionStorage.clear();
						localStorage.clear();
						this.axios.defaults.headers['Authorization'] = '';
						this.$toast(res.msg);
						this.$router.push({
							path: '/Login'
						});
					})
				}).catch(() => {

				});
			}
		},
		created() {},
		mounted() {},
		destroyed() {

		},
		filters: {}
	};
</script>

<style lang="less" scoped>
	/deep/ .van-nav-bar {
		background-color: #43add5;
	}
	
	/deep/ .van-nav-bar .van-icon {
		color: white;
	}
	
	/deep/ .van-nav-bar__title {
		color: white;
	}
	
	/deep/ .van-nav-bar__arrow {
		font-size: 18px;
	}
	
	/deep/ .van-nav-bar__text {
		color: white;
	}
	
	.overlay {
		background: #f2f4f5 !important;
	}
	
	/deep/ .van-button--info {
		background-color: #43add5;
		border: 1px solid #43add5;
	}
	
	/deep/ .van-button {
		height: 40px;
		line-height: 38px;
	}
</style>